package org.zcl.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zcl.enums.StrategyEnum;
import org.zcl.utils.QueryService;

import java.util.List;

/**
 * @Package org.zcl.controller
 * @PROJECT_NAME: question
 * @DESCRIPTION:
 * @USER: zhuchenglin
 * @DATE: 2021/12/3 17:04
 */
@RestController
@Slf4j
public class IndexController {

    @PostMapping("save")
    public List<String> save(Integer type) throws Exception {
        log.info("类型type:{}", type);
        QueryService queryService = StrategyEnum.getAdapter(type);
        return queryService.query();
    }
}
